package xiaolong.zhou.spring_demo.Utils;
//设置统一响应方式
public class Result {
    private Integer status;
    private String message;
    private Object data;

    public Result(Integer status, String message, Object data) {
        this.status = status;
        this.message = message;
        this.data = data;
    }

    public Result() {
    }

    public Integer getStatus() {
        return status;
    }

    public String getMessage() {
        return message;
    }

    public Object getData() {
        return data;
    }

    public void setCode(Integer Status) {
        this.status = Status;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public static Result success() {
        return new Result(200, "success", null);
    }

    public static Result error(String message) {
        return new Result(0, message, null);
    }

    public static Result success(Object data) {
        return new Result(200, "success", data);
    }
}

